import HouseLeaseApi from '@/api/HouseLeaseApi';

export default class HouseLeaseBusiness {
  /**
   * 添加租赁记录
   * @param data
   */
  static addLease(data: { houseId: number, tenantId: number, landlordId: number, leaseMonths: number }) {
    return HouseLeaseApi.addLease(data);
  }

  /**
   * 获取租赁记录状态
   * @param houseId 房屋id
   * @param tenantId 租客id
   */
  static getLeaseStatus(houseId: number, tenantId: number) {
    return HouseLeaseApi.getLeaseStatus(houseId, tenantId);
  }

  /**
   * 获取租客的租赁申请（待处理）
   */
  static getTenantLeasePendingTodoByLandlordId() {
    return HouseLeaseApi.getTenantLeasePendingTodoByLandlordId();
  }

  /**
   * 更新租赁记录状态
   * @param data
   */
  static updateLeaseStatus(data: { landlordId: number, tenantId: number, houseId: number, status: number }) {
    return HouseLeaseApi.updateLeaseStatus(data);
  }

  /**
   * 租客退租
   * @param leaseId
   */
  static tenantRefund(leaseId: number) {
    return HouseLeaseApi.tenantRefund(leaseId);
  }

  /**
   * 获取租客退租历史
   * @param tenantId
   */
  static getTenantRefundHistory(tenantId: number) {
    return HouseLeaseApi.getTenantRefundHistory(tenantId);
  }

  /**
   * 获取房屋的租赁状态（返回租赁的租客信息）
   * @param houseId
   */
  static getLeaseByHouseId(houseId: number) {
    return HouseLeaseApi.getLeaseByHouseId(houseId);
  }
}